Conversation
…hedule) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot recompile |
Recompiled all 158 workflow files — no changes needed, lock files were already up to date. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes concurrency helper functions to correctly handle synthetic events (slash_command) that exist only in input YAML before compile-time expansion. The fixes ensure that slash_command workflows get the correct concurrency configuration regardless of when the concurrency helpers are called (before or after event expansion).
Changes:
- Fixed
isWorkflowDispatchOnlyto recognizeslash_commandas a non-dispatch-only trigger by adding it to theotherTriggerslist - Added
isSlashCommandWorkflowhelper function to detect slash_command in YAML - Updated
hasSpecialTriggersto explicitly check for slash_command workflows - Updated
buildConcurrencyGroupKeysto include issue/PR number for slash_command workflows - Fixed
applyDefaultsto detect command triggers from shorthand form by checkingdata.Commandbefore re-reading the file - Added comprehensive test coverage for all slash_command scenarios
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflow/concurrency.go | Adds slash_command handling to concurrency helper functions; introduces isSlashCommandWorkflow helper; updates documentation |
| pkg/workflow/tools.go | Fixes command trigger detection in applyDefaults to handle slash_command shorthand by checking data.Command first |
| pkg/workflow/concurrency_test.go | Adds comprehensive test coverage for slash_command workflows including TestIsWorkflowDispatchOnly, TestHasSpecialTriggers, and tests for both map and shorthand formats |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey This PR is aligned with the project's contribution guidelines:
Verdict: 🟢 Aligned — Quality: This looks ready for maintainer review. 🚀
|
Concurrency helpers operated on
workflowData.Onwithout understanding synthetic events (slash_command) that exist only in input YAML before compile-time expansion to their GitHub Actions equivalents.Bugs fixed
isWorkflowDispatchOnly— false positive for slash_commandInput YAML
on: slash_command + workflow_dispatchwas incorrectly classified as dispatch-only becauseslash_commandwasn't inotherTriggers. Sinceslash_commandexpands toissue_comment + workflow_dispatch, its presence means the workflow is not dispatch-only.hasSpecialTriggers— no slash_command pathRelied on
isWorkflowDispatchOnlyreturningtruefor slash_command workflows (the wrong reason). Now has an explicitisSlashCommandWorkflowcheck.buildConcurrencyGroupKeys— wrong group key for slash_command input YAMLWhen
isCommandTrigger=falseandonstill containedslash_command:, the issue/PR number key was skipped, producing a generic group instead of${{ github.event.issue.number || github.event.pull_request.number }}.applyDefaults— slash_command shorthandon: /cmd-namenot detectedRe-read the raw file to detect command triggers, but the shorthand form is a plain string in the file (
on: /cmd-name), whileparseOnSectionhad already expanded it to the slash_command map in memory and populateddata.Command. Fixed by checkingdata.Commandfirst.Changes
concurrency.go— addsslash_commandtoisWorkflowDispatchOnly'sotherTriggers; addsisSlashCommandWorkflowhelper; updateshasSpecialTriggersandbuildConcurrencyGroupKeysto handle slash_command explicitlytools.go(applyDefaults) — checksdata.Commandbefore re-reading the file to detect command trigger, covering the shorthand formconcurrency_test.go— addsTestIsWorkflowDispatchOnlyandTestHasSpecialTriggers; extendsTestGenerateConcurrencyConfig,TestGenerateJobConcurrencyConfig,TestBuildConcurrencyGroupKeys, andTestConcurrencyRuleswith slash_command (both map and shorthand form) cases